<template>
  <el-container style="border: 1px solid #eee" v-loading="generating"
                element-loading-text="正在生成代码,请稍后..."
                element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0.8)">
    <LinkPanel/>
    <ContentPanel/>
  </el-container>
</template>

<script>

  import LinkPanel from "./components/LinkPanel";
  import ContentPanel from "./components/ContentPanel";
  import Pubsub from 'pubsub-js';

  export default {
    name: "App",
    components: {LinkPanel, ContentPanel},
    mounted() {
      Pubsub.subscribe("generating", (msg, flag) => { //订阅消息 回调函数有两个参数 第一个为订阅的消息key 第二个参数为数据
        this.generating = flag;

      });
      window.app = this;
      this.$store.dispatch("loadLinks");
    }, data() {
      return {
        generating: false
      };
    }
  }

</script>

<style scoped>


</style>
